package cn.weseal.cxf.client;


import cn.weseal.cxf.domain.Cat;
import cn.weseal.cxf.domain.User;
import cn.weseal.cxf.ws.HelloWorld;

import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import java.net.URL;
import java.util.List;

/**
 * Created by Administrator on 2015/7/15.
 */
public class ClientDemo {
    public static void main(String[] args) throws Exception {
        URL url=new URL("http://localhost:8181/?wsdl");
        QName qName=new QName("http://impl.ws.cxf.weseal.cn/","HelloWorldImplService");
        Service service= Service.create(url, qName);
        HelloWorld he= service.getPort(HelloWorld.class);
        System.out.println(he.sayHello("weseal"));
        User user=new User("qing", 1, "77887788778", "qing11");
        List<Cat> cats=  he.getCatsByUser(user);
        System.out.println("-----------------");
        System.out.println(user);
        System.out.println("-----------------");
        System.out.println(cats);
    }
}
